<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>CLARITICK - Gestion{% block title %}{% endblock %}</title>
    <!-- Admin -->
    <link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/base.css{% endblock %}" />
    <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}style.css" />
    {% block extrastyle %}
    <style type="text/css" media="screen">
        ul.errorlist {
            margin-top: 10px !important;
        }
    </style>
    {% endblock %}
    {{ form.media }}
    {% include "dojango/include.html" %}
    <!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{% block stylesheet_ie %}{% load adminmedia %}{% admin_media_prefix %}css/ie.css{% endblock %}" /><![endif]-->
    {% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% admin_media_prefix %}css/rtl.css{% endblock %}" />{% endif %}
    <script type="text/javascript">window.__admin_media_prefix__ = "{% filter escapejs %}{% admin_media_prefix %}{% endfilter %}";</script>
    {% block extrahead %}{% endblock %}
    {% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
    <!-- End admin -->
    <script type="text/javascript" src="{{ MEDIA_URL }}js/clariadmin.js"></script>
    <script type="text/javascript" charset="utf-8">
        dojo.config['ioPublish'] = true;
    </script>
    <script type="text/javascript" charset="utf-8">
        var MENU_CAN_HIDE = true;

        function go_to_ticket(num) {
            dojo.doc.location = '/ticket/modify/' + num + "/";
        }
        dojo.addOnLoad(function() {
            dojo.connect(dojo.byId("id_num_ticket"), "onchange", function() {
                go_to_ticket(dojo.byId("id_num_ticket").value);
            });
            dojo.connect(dijit.byId("id_go_ticket"), "onClick", function() {
                go_to_ticket(dojo.byId("id_num_ticket").value);
            });
        });
       function go_to_host(arg) {
            postwith({global_search:arg},"{% url clariadmin.views.list_all %}" );
        }
        dojo.addOnLoad(function() {
            dojo.connect(dojo.byId("id_num_host"), "onchange", function() {
                go_to_host(dojo.byId("id_num_host").value);
            });
        });
    </script>
    <script type="text/javascript" src="{{ MEDIA_URL }}javascript/claritick.js"></script>
    {% block extrajs %}{% endblock %}
{% block activation_trafiquables %}
    <script type="text/javascript" src="{{ MEDIA_URL }}javascript/trafiquable.js"></script>
    <script type="text/javascript">
        dojo.addOnLoad(function()
            {
            dojo.forEach(dojo.query("table.trafiquable"), function(table, index)
                {
                  if (table.id) {
                    new Trafiquable(table.id,'{% url common.views.trafiquable %}');
                  }
                });
            });
    </script>
{% endblock %}
    <script type="text/javascript" src="{{ MEDIA_URL }}js/menu.js"></script>
  </head>
{% load i18n %}
  <body class="{{ DOJANGO.THEME }} {% if is_popup %}popup {% endif %}{% block bodyclass %}claritick{% endblock %}">
    {% if not is_popup %}

    <div id="gauche">
        {% block claritick_menu %}
        <h2><img src="{{ MEDIA_URL }}images/icon-home.png" alt="home" />Général</h2>
        <ul class="menu">
            <li><a href="/">Accueil</a></li>
    {% if user.is_authenticated %}
            <li><a href="/agenda/">Agenda</a></li>
            {% if user.is_staff %}
            <li><a href="/admin/">Administration</a></li>
            {% endif %}
            {% if perms.ticket.can_view_report %}
            <li><a href="/reporting/ticket/">Reporting</a></li>
            {% endif %}
            {% if perms.ticket.can_view_qbuilder %}
            <li><a href="/qbuilder/">Query Builder</a></li>
            {% endif %}
            <li><a href="{% url infos_login %}">Identification</a></li>
        </ul>

        <h2><img src="{{ MEDIA_URL }}images/icon-new.png" alt="+" />Création</h2>
        <ul class="menu">
            <li><a href="/ticket/partial_new/">Ticket</a></li>
        </ul>

        <h2><img src="{{ MEDIA_URL }}images/icon-list.png" alt="/" />Tickets</h2>
        <ul class="menu">
            <li><a href="{% url ticket_list_all %}?reset=1">Tous</a></li>
            <li><a href="{% url ticket_list_me %}?reset=1">Les miens</a></li>
            <li><a href="{% url ticket_list_unassigned %}?reset=1">Non affectés</a></li>
            <li><a href="{% url ticket_list_nonvalide %}?reset=1">A valider</a></li>
            <li><a href="{% url ticket_list_notseen %}?reset=1">Non consultés</a></li>
            {% if ticket_views %}
            {% for view in ticket_views %}
            <li><a href="{% url ticket_list_view view.pk %}">{{ view.name }}</a></li>
            {% endfor %}
            {% endif %}
        </ul>
        {% if perms.clariadmin.can_access_clariadmin %}
        <h2><img src="{{ MEDIA_URL }}images/oxygen/computer.png" alt="/" />Clariadmin</h2>
        <ul class="menu">
          <li><a href="{% url list_hosts %}?reset=1">Toutes les machines</a></li>
          <li><a href="{% url new_host %}">Nouvelle machine</a></li>
          {% if perms.host_history.can_access_host_history %}<li><a href="{% url list_logs %}?reset=1">Historique Machines</a></li>{% endif %}
          {% if perms.clariadmin.can_access_hostiplog %}<li><a href="{% url list_hostiplog %}?reset=1">Historique IP</a></li>{% endif %}
        </ul>
        {% endif %}
        {% if perms.smokeping.smokeping %}
        <h2><img src="{{ MEDIA_URL}}images/oxygen/esd.png" alt="smokeping" />Monitoring</h2>
        <ul class="menu">
          <li><a href="{% url smokeping %}">Smokeping</a></li>
        </ul>
        {% endif %}
        {% if perms.package.can_access %}
        <h2><img src="{{ MEDIA_URL }}images/oxygen/packaging.png" alt="/" />Déploiement</h2>
        <ul class="menu">
            <li><a href="/packaging/">Gestion</a></li>
        </ul>
        {% endif %}
    {% endif %}
        {% endblock %}
    </div>
    <div id="gauche-spin"></div>
    {# Token utilisé par recherche globale clariadmin et simuler un post en javascript depuis chaque page interne avec la fonction postwith(kwargs, url). #}
    {% csrf_token %}
    <table id="menuPrincipal" summary="Menu">
      <tr>
        <td align="left" width="33%">
          <a href="/"><img src="{{ MEDIA_URL }}images/accueil.png" alt="accueil" /></a>
          {% if ticket_alarms_count %}{{ ticket_alarms_count }} alarmes actives!{% endif %}
            {% if user.is_authenticated %}
            <p><a class="bouton" href="/accounts/logout"><img src="{{ MEDIA_URL }}images/oxygen/disconnect.png" alt="disconnect" />Déconnexion</a><!--<br />(autologout: {{ request.autologout_enabled }})--></p>
            {% endif %}
        </td>
        <td valign="middle" align="center" width="33%">
            <a href="/"><img id="logoClaritick" src="{{ MEDIA_URL }}images/logo_pt.png" alt="logo" /></a>
        </td>
        <td align="right" width="33%" style="status">
          <span id="status">[ IDLE ]</span>
          {% if user.is_authenticated %}
            <p style="padding: 0; margin: 0; display: inline;">Utilisateur: {{ user.username }}</p>
          {% endif %}
          {% if user.is_authenticated %}
          <p style="padding: 0; margin: 0;">
            Aller au ticket # <input type="text" id="id_num_ticket" size="6" /> <button dojoType="dijit.form.Button" id="id_go_ticket">Go</button>
            {% if perms.clariadmin.can_access_clariadmin %}
              <br />Clariadmin: <input type="text" id="id_num_host" size="25" />
            {% endif %}
          </p>
          {% endif %}
        </td>
      </tr>
      <tr id="ie_tr" style="display: none;"><td colspan="3" style="text-align: center; font-size: 1.4em;"><a href="{% url internet_explorer %}" style="color: red;">Internet explorer n'est pas supporte.</a></td></tr>
    </table>
    <script type="text/javascript">
      if (dojo.isIE) {
        dojo.style("ie_tr", "display", "block");
      }
    </script>
    <div id="contenu" class="{% block admin_class %}claritick{% endblock %}">
        <h1 class="title">{% block breadcrumbs %}{% endblock %}{% block content_title %}{% if title %}{{ title }}{% endif %}{% endblock content_title %}</h1>
        <div class="image">{% block image %}{% endblock image %}</div>
    {% endif %}
        {% block content %}{% endblock content %}
        {% block sidebar %}{% endblock %}
        <br class="clear" />
    {% if not is_popup %}
    </div>
    {% endif %}{# ispopup #}

    {% if DOJANGO.COLLECTOR %}
    <!-- Dojo -->
    <script type="text/javascript">
        {% for require in DOJANGO.COLLECTOR %}
            dojo.require("{{ require }}");
        {% endfor %}
    </script>
    <!-- End Dojo -->
    {% endif %}
  </body>
</html>

